//
//  LNNewsViewController.m
//  LNDevelopExample
//
//  Created by wwww on 2018/9/7.
//  Copyright © 2018年 淘发现1iOS. All rights reserved.
//

#import "LNNewsViewController.h"
#import "LNFoodsViewCell.h"
@interface LNNewsViewController ()

@end

@implementation LNNewsViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // 注册Cell
    
    [self.collectionView ln_registerNibCell:LNFoodsViewCell.class];
}

#pragma mark - Override
-(void)bindViewModel{
    [super bindViewModel];
}

#pragma mark - 初始化UI
-(void)setupUI{
    
    
}

#pragma mark - Override
/// 配置tableView的区域
- (UIEdgeInsets)contentInset{
    return UIEdgeInsetsMake(LN_APPLICATION_TOP_BAR_HEIGHT, 0, LN_APPLICATION_TAB_BAR_HEIGHT, 0);
}

#pragma mark - 重写父类方法
//定义每个UICollectionView 的边距
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{

    return CGSizeMake((LN_SCREEN_WIDTH-15)/2, kHeight(180));
}

/// dequeueReusableCell
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView dequeueReusableCellWithReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath{
    
    return [collectionView dequeueReusableCellWithReuseIdentifier:@"LNFoodsViewCell" forIndexPath:indexPath];
}

/// configure cell data
- (void)configureCell:(LNFoodsViewCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object{
    
    [cell bindViewModel:object];
}
@end
